using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
    /// <summary>
    /// Summary description for KHACHHANG.
    /// </summary>
    public class KHACHHANGList : CollectionBase
    {
		private string _ErrMsg;
        public string ErrMsg { get { return _ErrMsg; } }
    	public KHACHHANGList()
    	{
	    }

		public void Add(KHACHHANG entity)
		{
            this.List.Add(entity);
		}

		public void Add(KHACHHANGList list)
		{	
			foreach(KHACHHANG entity in list)
			{
				this.Add(entity);
			}
		}
	
		public new virtual Enumerator GetEnumerator()
		{
		    return new Enumerator(this);
		}
		public virtual KHACHHANG this[int index]
		{
		    get
			{
				return (KHACHHANG)this.List[index];
			}
			set
			{
				this.List[index] = value;
			}
		}

		#region Find Object And List Object
		//---PrimaryKey
	public virtual KHACHHANG Find(Guid MAKHACHHANG)
	{
	    foreach (KHACHHANG obj in this.List)
	    {
		if(obj.MAKHACHHANG.ToString().ToUpper().Trim() == MAKHACHHANG.ToString().ToUpper().Trim())
		{
		    obj.IsExisting = true;
		    return obj;
		}
	    }
	    return null;
	}

public virtual KHACHHANGList FindListByMAKHACHHANG(Guid MAKHACHHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
		    if(obj.MAKHACHHANG.ToString().ToUpper().Trim() == MAKHACHHANG.ToString().ToUpper().Trim())
		    {
				List.Add(obj);
		    }
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
    	{
		_ErrMsg = ex.Message;
        		return null;
    	}
}
		//---NonPrimaryKey
        public virtual KHACHHANG FindByMABARCODE(string MABARCODE)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.MABARCODE.ToString().ToUpper().Trim() == MABARCODE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByHINHANH(byte[] HINHANH)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.HINHANH.ToString().ToUpper().Trim() == HINHANH.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCODEKHACHHANG(string CODEKHACHHANG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CODEKHACHHANG.ToString().ToUpper().Trim() == CODEKHACHHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCMND(string CMND)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CMND.ToString().ToUpper().Trim() == CMND.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByMAKHUVUC(Int32 MAKHUVUC)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.MAKHUVUC.ToString().ToUpper().Trim() == MAKHUVUC.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByMANHOM(Int32 MANHOM)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.MANHOM.ToString().ToUpper().Trim() == MANHOM.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByMALOAIKHACHHANG(Int32 MALOAIKHACHHANG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.MALOAIKHACHHANG.ToString().ToUpper().Trim() == MALOAIKHACHHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByTENKHACHHANG(string TENKHACHHANG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.TENKHACHHANG.ToString().ToUpper().Trim() == TENKHACHHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByMASOTHUE(string MASOTHUE)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.MASOTHUE.ToString().ToUpper().Trim() == MASOTHUE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGUOIDAIDIEN(string NGUOIDAIDIEN)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGUOIDAIDIEN.ToString().ToUpper().Trim() == NGUOIDAIDIEN.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGAYSINH(DateTime NGAYSINH)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGAYSINH.ToString().ToUpper().Trim() == NGAYSINH.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByGIOITINH(string GIOITINH)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.GIOITINH.ToString().ToUpper().Trim() == GIOITINH.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCHUCVU(string CHUCVU)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CHUCVU.ToString().ToUpper().Trim() == CHUCVU.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIACHI(string DIACHI)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIACHI.ToString().ToUpper().Trim() == DIACHI.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIENTHOAI(string DIENTHOAI)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIENTHOAI.ToString().ToUpper().Trim() == DIENTHOAI.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByFAX(string FAX)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.FAX.ToString().ToUpper().Trim() == FAX.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIDONG(string DIDONG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIDONG.ToString().ToUpper().Trim() == DIDONG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByEMAIL(string EMAIL)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.EMAIL.ToString().ToUpper().Trim() == EMAIL.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCHECKTPYE(Int32 CHECKTPYE)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CHECKTPYE.ToString().ToUpper().Trim() == CHECKTPYE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByGHICHU(string GHICHU)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.GHICHU.ToString().ToUpper().Trim() == GHICHU.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIACHICONGTY(string DIACHICONGTY)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIACHICONGTY.ToString().ToUpper().Trim() == DIACHICONGTY.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByTENTATKHACHHANG(string TENTATKHACHHANG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.TENTATKHACHHANG.ToString().ToUpper().Trim() == TENTATKHACHHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCONGTY(string CONGTY)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CONGTY.ToString().ToUpper().Trim() == CONGTY.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIACHIGIAOHOADON(string DIACHIGIAOHOADON)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIACHIGIAOHOADON.ToString().ToUpper().Trim() == DIACHIGIAOHOADON.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIACHIGIAOHANG(string DIACHIGIAOHANG)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIACHIGIAOHANG.ToString().ToUpper().Trim() == DIACHIGIAOHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByDIACHIGIAOHANG2(string DIACHIGIAOHANG2)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.DIACHIGIAOHANG2.ToString().ToUpper().Trim() == DIACHIGIAOHANG2.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByTONGCONGNO(decimal TONGCONGNO)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.TONGCONGNO.ToString().ToUpper().Trim() == TONGCONGNO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByGIOIHANCONGNO(decimal GIOIHANCONGNO)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.GIOIHANCONGNO.ToString().ToUpper().Trim() == GIOIHANCONGNO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByGIOIHANSONGAYNO(Int32 GIOIHANSONGAYNO)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.GIOIHANSONGAYNO.ToString().ToUpper().Trim() == GIOIHANSONGAYNO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGAYNOGANNHAT(DateTime NGAYNOGANNHAT)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGAYNOGANNHAT.ToString().ToUpper().Trim() == NGAYNOGANNHAT.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCHIETKHAU(double CHIETKHAU)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CHIETKHAU.ToString().ToUpper().Trim() == CHIETKHAU.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByCHECKKHUYENMAI(Int32 CHECKKHUYENMAI)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.CHECKKHUYENMAI.ToString().ToUpper().Trim() == CHECKKHUYENMAI.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByISUSE(bool ISUSE)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.ISUSE.ToString().ToUpper().Trim() == ISUSE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByISDELETE(bool ISDELETE)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.ISDELETE.ToString().ToUpper().Trim() == ISDELETE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGAYTAO(DateTime NGAYTAO)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGAYTAO.ToString().ToUpper().Trim() == NGAYTAO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGUOITAO(string NGUOITAO)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGUOITAO.ToString().ToUpper().Trim() == NGUOITAO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGAYCAPNHAT(DateTime NGAYCAPNHAT)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGAYCAPNHAT.ToString().ToUpper().Trim() == NGAYCAPNHAT.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual KHACHHANG FindByNGUOICAPNHAT(string NGUOICAPNHAT)
        {
	        foreach (KHACHHANG obj in this.List)
	        {
		        if(obj.NGUOICAPNHAT.ToString().ToUpper().Trim() == NGUOICAPNHAT.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

public virtual KHACHHANGList FindListByMABARCODE(string MABARCODE)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.MABARCODE.ToString().ToUpper().Trim() == MABARCODE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByHINHANH(byte[] HINHANH)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.HINHANH.ToString().ToUpper().Trim() == HINHANH.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCODEKHACHHANG(string CODEKHACHHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CODEKHACHHANG.ToString().ToUpper().Trim() == CODEKHACHHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCMND(string CMND)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CMND.ToString().ToUpper().Trim() == CMND.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByMAKHUVUC(Int32 MAKHUVUC)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.MAKHUVUC.ToString().ToUpper().Trim() == MAKHUVUC.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByMANHOM(Int32 MANHOM)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.MANHOM.ToString().ToUpper().Trim() == MANHOM.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByMALOAIKHACHHANG(Int32 MALOAIKHACHHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.MALOAIKHACHHANG.ToString().ToUpper().Trim() == MALOAIKHACHHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByTENKHACHHANG(string TENKHACHHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.TENKHACHHANG.ToString().ToUpper().Trim() == TENKHACHHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByMASOTHUE(string MASOTHUE)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.MASOTHUE.ToString().ToUpper().Trim() == MASOTHUE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGUOIDAIDIEN(string NGUOIDAIDIEN)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGUOIDAIDIEN.ToString().ToUpper().Trim() == NGUOIDAIDIEN.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGAYSINH(DateTime NGAYSINH)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGAYSINH.ToString().ToUpper().Trim() == NGAYSINH.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByGIOITINH(string GIOITINH)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.GIOITINH.ToString().ToUpper().Trim() == GIOITINH.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCHUCVU(string CHUCVU)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CHUCVU.ToString().ToUpper().Trim() == CHUCVU.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIACHI(string DIACHI)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIACHI.ToString().ToUpper().Trim() == DIACHI.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIENTHOAI(string DIENTHOAI)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIENTHOAI.ToString().ToUpper().Trim() == DIENTHOAI.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByFAX(string FAX)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.FAX.ToString().ToUpper().Trim() == FAX.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIDONG(string DIDONG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIDONG.ToString().ToUpper().Trim() == DIDONG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByEMAIL(string EMAIL)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.EMAIL.ToString().ToUpper().Trim() == EMAIL.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCHECKTPYE(Int32 CHECKTPYE)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CHECKTPYE.ToString().ToUpper().Trim() == CHECKTPYE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByGHICHU(string GHICHU)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.GHICHU.ToString().ToUpper().Trim() == GHICHU.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIACHICONGTY(string DIACHICONGTY)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIACHICONGTY.ToString().ToUpper().Trim() == DIACHICONGTY.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByTENTATKHACHHANG(string TENTATKHACHHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.TENTATKHACHHANG.ToString().ToUpper().Trim() == TENTATKHACHHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCONGTY(string CONGTY)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CONGTY.ToString().ToUpper().Trim() == CONGTY.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIACHIGIAOHOADON(string DIACHIGIAOHOADON)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIACHIGIAOHOADON.ToString().ToUpper().Trim() == DIACHIGIAOHOADON.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIACHIGIAOHANG(string DIACHIGIAOHANG)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIACHIGIAOHANG.ToString().ToUpper().Trim() == DIACHIGIAOHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByDIACHIGIAOHANG2(string DIACHIGIAOHANG2)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.DIACHIGIAOHANG2.ToString().ToUpper().Trim() == DIACHIGIAOHANG2.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByTONGCONGNO(decimal TONGCONGNO)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.TONGCONGNO.ToString().ToUpper().Trim() == TONGCONGNO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByGIOIHANCONGNO(decimal GIOIHANCONGNO)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.GIOIHANCONGNO.ToString().ToUpper().Trim() == GIOIHANCONGNO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByGIOIHANSONGAYNO(Int32 GIOIHANSONGAYNO)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.GIOIHANSONGAYNO.ToString().ToUpper().Trim() == GIOIHANSONGAYNO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGAYNOGANNHAT(DateTime NGAYNOGANNHAT)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGAYNOGANNHAT.ToString().ToUpper().Trim() == NGAYNOGANNHAT.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCHIETKHAU(double CHIETKHAU)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CHIETKHAU.ToString().ToUpper().Trim() == CHIETKHAU.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByCHECKKHUYENMAI(Int32 CHECKKHUYENMAI)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.CHECKKHUYENMAI.ToString().ToUpper().Trim() == CHECKKHUYENMAI.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByISUSE(bool ISUSE)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.ISUSE.ToString().ToUpper().Trim() == ISUSE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByISDELETE(bool ISDELETE)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.ISDELETE.ToString().ToUpper().Trim() == ISDELETE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGAYTAO(DateTime NGAYTAO)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGAYTAO.ToString().ToUpper().Trim() == NGAYTAO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGUOITAO(string NGUOITAO)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGUOITAO.ToString().ToUpper().Trim() == NGUOITAO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGAYCAPNHAT(DateTime NGAYCAPNHAT)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGAYCAPNHAT.ToString().ToUpper().Trim() == NGAYCAPNHAT.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual KHACHHANGList FindListByNGUOICAPNHAT(string NGUOICAPNHAT)
{
	try
	{
		KHACHHANGList List = new KHACHHANGList();
		foreach (KHACHHANG obj in this.List)
		{
			if(obj.NGUOICAPNHAT.ToString().ToUpper().Trim() == NGUOICAPNHAT.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}
		#endregion
     
		#region Inner Classes
		/// <summary>
		/// Type-specific enumeration class, used by LogCollection.GetEnumerator.
		/// </summary>
		public class Enumerator : IEnumerator
		{
			private IEnumerator wrapped;

			public Enumerator(KHACHHANGList collection)
			{
				this.wrapped = ((CollectionBase)collection).GetEnumerator();
			}

			public KHACHHANG Current
			{
				get
				{
					return (KHACHHANG)(this.wrapped.Current);
				}
			}

			object IEnumerator.Current
			{
				get
				{
					return (KHACHHANG)(this.wrapped.Current);
				}
			}

			public bool MoveNext()
			{
				return this.wrapped.MoveNext();
			}

			public void Reset()
			{
				this.wrapped.Reset();
			}
      }
      #endregion  
   }
}